<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="width=device-width,initial-scale=1, maximum-scale=1.0, user-scalable=no" />
<title>播放</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/resources/wap/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/resources/wap/css/public.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/resources/wap/css/font-awesome.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/resources/wap/css/swiper.min.css" />
</head>
<body>
	<div style="width:100%;height:100%;overflow: scroll;position: absolute; -webkit-overflow-scrolling: touch;">

	<!-- logo和搜索功能 -->
	<div class="tb-logo">
		<span class="float-l pic" id="toIndex"><img
			src="${pageContext.request.contextPath }/resources/wap/img/logo.png"
			alt="" /></span>
		<div class="tb-srch">
			<form action="${pageContext.request.contextPath }/wap/search.html"
				id="searchForm">
				<span class="shuru"> <input id="search-input" type="text"
					name="name" id="name" value="" /></span> <span class="fa fa-search btn"
					aria-hidden="true" id="submitForm"></span>
			</form>
		</div>
		<script type="text/javascript">
		    
		  
		    </script>
	</div>
	<!-- 视频播放器 -->
	<div class="vd">
		<p>
			<span>${video.title}</span>
		</p>
		<!-- 暂时使用title作为视频标题（录入时标题上加剧集数） 
	    		   如果维护时过于麻烦推荐使用下面注释的方法（缺点是电影也会显示setNum） 
	    	-->
		<div class="bfq">
			<video id="videoPlayer" controls="controls" width="100%"
				poster='${baseImgPath}${video.poster}' x-webkit-airplay="true"
				webkit-playsinline="true">
				<source src="${video.url }" type="video/mp4">
				<source src="${video.h360pUrl }" type="video/mp4">
				<source src="${video.h720pUrl }" type="video/mp4">
				<source src="${video.h1080pUrl }" type="video/mp4">
			</video>
			<!-- 分享功能 -->
			<div class="gn">
				<div style="float:left">
						<a class="fa fa-share-alt" aria-hidden="true" href="javascript:void(0)"></a> 
							<a href="javascript:void(0)" class="fengx">分享</a> 
					<div id="share" style="float:right">
						<div class="bdsharebuttonbox" style="display:inline;">
								<a class="bds_weixin "  data-cmd="weixin" href="javascript:void(0)" ></a>
								<a class="bds_qzone " data-cmd="qzone" href="javascript:void(0)"></a>
								<a class="bds_tsina " data-cmd="tsina" href="javascript:void(0)" ></a>
						</div>
					</div>
				</div>
<!-- 							<a class="fa fa-weibo" aria-hidden="true" href="javascript:void(0)" onclick="shareWechat()"></a>  -->
<!-- 							<a class="fa fa-weixin" aria-hidden="true" href="javascript:void(0)"></a>  -->
<!-- 							<a class="fa fa-qq" aria-hidden="true" href="javascript:void(0)"></a>  -->
							<a class="fa fa-thumbs-o-up padding-x" id="touch" aria-hidden="true" href="javascript:void(0)" ></a>
						<a class="fengx" href="javascript:void(0)" id="zan">${video.likeCount}</a>
			</div>
			
		</div>
	</div>
	<ul class="list-tb  list-vd">
		<li class="li-ch">剧集列表</li>
		<li>剧集信息</li>
		<li>用户评论</li>
	</ul>
	<div class='bd' style="background: #ffffff;">
		<div class="detail-list">
			<ul class="xj-list">
				<c:forEach var="i" begin="0" end="${listVideoSeries.size()}"
					step="1">
					<c:if test="${listVideoSeries[i].setNum!=null}">
						<li class="sure"><a
							href="${pageContext.request.contextPath }/wap/detail/show.html?seriesId=${listVideoSeries[i].seriesId}&setNum=${listVideoSeries[i].setNum}#c_2"
							id="series_${listVideoSeries[i].setNum}"> <c:out
									value="${listVideoSeries[i].setNum }" />
						</a></li>
					</c:if>
					<%-- <c:if test="${bVideoList[i].setNum==null}"><li class="none"><a href="javascript:void(0);" ><c:out value="${i+1}"/></a></li></c:if> --%>
				</c:forEach>
			</ul>

			<!-- 喜好关联 -->
			<p>猜你喜欢</p>
			<ul class="film-ul width-half">
				<c:forEach items="${listBSeries}" var='mayLikeSeries'>
					<li><a
						href="${pageContext.request.contextPath }/wap/detail/show.html?seriesId=${mayLikeSeries.id}&setNum=1">
							<img src="${baseImgPath}${ mayLikeSeries.poster}" alt="" />
							<p class="c-title">${mayLikeSeries.name}</p>
							<p class="c-word">${mayLikeSeries.description}</p> <span
							class="bj">独播</span>
					</a></li>
				</c:forEach>
			</ul>
		</div>
		<!-- 剧集信息 -->
		<div class="detail-list ds-none">
			<h4 style="padding-bottom: 5px;">
				<strong>${bSeriesThis.name }</strong>
			</h4>
			<ul class="xq-h">
				<li>类型：<span>${bSeriesThis.typeName}</span></li>
				<li>导演：<span>${bSeriesThis.director }</span></li>
				<li>主演：<span>${bSeriesThis.actor }</span></li>
				<li>简介：
					<p>${bSeriesThis.summary}</p>
				</li>
			</ul>
		</div>
		<div class="detail-list ds-none">
			<div class="pl-top">评论</div>
			<div class="pl-top">
				<div class="pl-self-tx">
					<img
						src="${pageContext.request.contextPath }/resources/wap/img/tx.jpg"
						alt="" />
				</div>
				<div class="pl-self-bd">
					我要评论
				</div>
			</div>
			<!-- 评论区 -->
			<div id="commentArea">
			
			</div>
		</div>
	</div>

	<div class="test">
		<c:forEach items="${parentComment}" var='mayLikeSeries'>
					<li>
							<p>${mayLikeSeries.content}</p>
							
					</li>
				</c:forEach>
	</div>
	<div class="footer">
		<div class="footer-bd">
			<ul>
			</ul>
			<p class="bq">Copyright © 2016 All Rights Reserved.</p>
		</div>
	</div>
</div>

		<div style="" class="ssx">
        	<div class="tc-input">
        		<span class="titlex">评论<span class="fa fa-times close" aria-hidden="true"></span></span>
        		<label id="gpt">你还可以输入<var style="color: #C00">300</var>个字符。</label>	
        		<textarea placeholder="回复" onmousedown="s(event,this)"  maxlength="300"
					  onchange="this.value=this.value.substring(0, 300)"
					   onkeydown="this.value=this.value.substring(0, 300)" 
					   onkeyup="this.value=this.value.substring(0, 300)"></textarea>
			    <span class="fabiao"><a href="javascript:void(0)" id ="parentComment">发表</a></span>
			</div>
        </div>
	
	



	<script type="text/javascript" src="${pageContext.request.contextPath }/resources/wap/js/jquery-2.2.3.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/resources/wap/js/bootstrap.min.js"></script>
	<script type="text/javascript">

	    	$(document).ready(function(){

	    		
				var shuH=$('.bd .film-ul li').width()*1.45;
				
				$('.bd .film-ul li img').height(shuH);

				$('.pl-self-bd').click(function(){                	
	                $('.ssx').show();
	                $('.tc-input textarea').focus();	                
	            });
                //$('.tc-input textarea').blur(function(){
                //	$('.ssx').hide();
                	
                //});
               
                $('.tc-input .close').click(function(){
                	$('.ssx').hide();
                	$('.tc-input textarea').val('');
                }); 
	    		$('.list-vd li').each(function(index){
	    		 	$(this).click(function(){
	                 	$(this).addClass('li-ch').siblings().removeClass('li-ch');
	                 	$('.detail-list').eq(index).removeClass('ds-none').siblings().addClass('ds-none')
	                 });
	    		 })
                 
                 $('.xj-list li').click(function(){
                 	$(this).addClass('li-this').siblings().removeClass('li-this')
                 });
                 $('.dz').click(function(){
                 	$(this).css('color','#ed7500');
                 })                                
//              function showTime(){
//               	
//               	var hh=$(window).height()-$('.tc-input').height();  	                 	
//	                $('.tc-input').css('top',hh);
//	                if($('.gg').show()){
//	                	$('.tc-input input').blur(function(){
//		                   $('.gg').hide();
//		                });
//	                }
//	                
//              }                
               
                $('.pl-self-bd').click(function(){                	 		                 	
//	                setInterval(showTime, 500);                                 	
	                $('.ssx').show();
	            });

	    	});
		
		</script>
		<script>
			window._bd_share_config = {
				"common" : {
					"bdSnsKey" : {},
					"bdText" : "火眼，给你更多",
					"bdMini" : "2",
					"bdMiniList" : false,
					"bdPic" : "${baseImgPath}${bVideo.poster}",
					"bdStyle" : "1",
					"bdSize" : "24"
				},
				"share" : {}
			};
			with (document)
				0[(getElementsByTagName('head')[0] || body)
						.appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='
						+ ~(-new Date() / 36e5)];
		</script>
		<script type="text/javascript">
		$(document).ready(function(){
			/*
		  	*格式化时间的方法(修改后不再使用)
		  	*/
		  	/* Date.prototype.Format = function (fmt) { //author: meizz 
		  	    var o = {
		  	        "M+": this.getMonth() + 1, //月份 
		  	        "d+": this.getDate(), //日 
		  	        "h+": this.getHours(), //小时 
		  	        "m+": this.getMinutes(), //分 
		  	        "s+": this.getSeconds(), //秒 
		  	        "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
		  	        "S": this.getMilliseconds() //毫秒 
		  	    };
		  	    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
		  	    for (var k in o)
		  	    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
		  	 	//fmt=fmt.replace(/\-/g, "/");
		  	 	
		  	    return fmt;
		  	} */
		  	getComments();     
		  	afterAdd();
			 
        });
		/*
		 * 播放控制
		 */
		 var vid = document.getElementById("videoPlayer");
			vid.ontimeupdate = function() {stopFunction()};
		/*
		 * 暂停并弹窗
		 */
		function stopFunction(){
			//控制食品播放的秒数
			if(vid.currentTime>5){
				//到达既定时间执行的事件
				vid.currentTime=0;
				vid.pause();
				var r=confirm("是否跳转到Pc链接观看？");
				if (r==true){
					//vid.pause();
					window.location.href="http://61.152.73.224:8080/webside-huoyan/public/index.html ";
				}
				else{
					
					//vid.currentTime  = 0;
					vid.pause();
				}
			}
			
		}
		
		/*
		 * 限制长度
		 */
				$("textarea").val("");
				var counter = $("textarea").val().length; //获取文本域的字符串长度
				$("#gpt var").text(300 - counter);
				$(document).keyup(function() {
				    var text = $("textarea").val();
				    var counter = text.length;
				    $("#gpt var").text(300 - counter);    //每次减去字符长度
				});
				
		
		
		/*
		 * 播放次数统计
		 */
		var play_time=0;
	  	var startTime="";
	  	var time=new Date();
	  	
		loginTime=time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
		
		window.onunload=function (){
			alert(1111);
			insertMongoRecord();
		}
		
		function timeHandler(t){
			if(parseInt(t)==0){
				var time=new Date();
				startTime=time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
			}
			if(t!=undefined && t/60>=1){
				play_time=parseInt(t/60);
			}
			
		} 
		
		
 		function insertMongoRecord(){
				var params={};
				timeHandler(vid.currentTime);
	    		params["seriesId"]="${bSeriesThis.id}";
	    		params["seriesName"]="${bSeriesThis.name}";
	    		params["seriesTypeName"]="${bSeriesThis.typeName}";
	    		params["seriesTypeCode"]="${bSeriesThis.type}";
	    		params["seriesKindName"]="${bSeriesThis.kindName}";
	    		params["seriesKindCode"]="${bSeriesThis.kind}";	
	    		params["channelCode"]="${bSeriesThis.channel}";	
	    		params["playDuration"]=play_time;	
	    		if(params["channelCode"]=="MOVIE"){
	    			params["channelName"]="电影";	
	    		}else if(params["channelCode"]=="TVPLAY"){
	    			params["channelName"]="电视剧";	
	    		}else{
	    			params["channelName"]="动漫";	
	    		}
	    		
	    		params["browerTime"]=loginTime;
	    		$.ajax({
	    			type:"post",
	    			async: false,
	    			data:params,
	    			url:"${pageContext.request.contextPath }/wap/detail/addRecord.html",
	    			
	    		});
			} 
 		
		/*
		 * 新增子评论的事件(异步生成页面必须写在初始化后)
		 */
 		function afterAdd(){
			 var child = $('.gn span:nth-child(2)');
			 
			 child.click(function(){
				 $('.ssx').show();
	             $('.tc-input textarea').focus();	
	             var c = $(this).parent();
	             //alert(c.attr("parentsid"));
	             $("#parentComment").attr("parentId",c.attr("parentsid"));
				
			 });
		  	}
		/*
		 *搜索功能
		 */
	  $("#submitForm").click(function(){
	    	$("#searchForm").submit();
   		});
		/*
		 * 跳转主页功能
		 */
	 $("#toIndex").click(function(){
		 window.location.href="${pageContext.request.contextPath }/wap/index.html"; 
	  });
		/*
		 * 新增点赞功能
		 */
		 $("#touch").click(function(){
			addLikeCount();
		 })
		
		 /*
		  *新增评论的事件
          */
        $('#parentComment').click(function(){
        	
        	var params ={};
        	params["type"] = "2";
        	params["videoId"] = '${video.id}';
        	params["parentId"] = $(this).attr("parentId");
        	params["content"] = $("textarea").val();
        	params["childrenCount"] = null;
         	
        	insertComment(params);
        	$("#parentComment").attr("parentId",'0');
        	$('.ssx').hide();
        	$('.tc-input textarea').val('');
        });
		
		
		 
	  $(".gn").hover(function(){
		 
	  });
    		
    		
    //新增评论
    function insertComment(param){
	 	var vId="${video.id}";
	 	
    	$.ajax({  
	    	 type: "GET",
             url:"${pageContext.request.contextPath }/wap/detail/insertComment1.html", 
             data:param,
             dataType: "json",  
             timeout: 1000,  
             cache: false, 
             async: false,
             error: errorFunction,  //错误执行方法    
             success: succFunction  //成功执行方法    
         });
    }
    //"${pageContext.request.contextPath }/wap/detail/insertComment1.html"
    //{videoId:param.videoId,type:param.type,parentId:param.parentId,content:param.content},childrenCount:param.childrenCount
    //新增评论失败
    function errorFunction() {  
       alert("对不起，出错了，请您重新发表评论！");
    } 
    //新增评论成功
    function succFunction(data) {
    	//alert("插入成功");
    	getComments();
    	afterAdd();	
    
    }

	       /*  	 if(pl_detail.html()!=null){
	        		html=pl_detail.html();
	        	 } */
	        	/*  if(pageNo>=0){
	        		 pl_detail=$("#pl_detail").html();
	        		 alert("ss");		        		 
	        	 } */
	        	 	//循环获取数据    
	 /*
	  * 新增评论后刷新评论区(点击评论按钮刷新评论区)
	  */
	  function getComments(){
	        var vId="${video.id}";      		 
	        var pageNo=0;
	        $.ajax({  
		    	 type: "GET",
	             url:"${pageContext.request.contextPath }/wap/detail/recomments.html", 
	           	 data: {videoId:'${video.id}',pageNo:0},
	             dataType: "json",  
	             timeout: 1000,  
	             cache: false, 
	             async: false,
	             error: errorCommentsFunction,  //错误执行方法    
	             success: succCommentsFunction  //成功执行方法    
	         });
	  }
	  function errorCommentsFunction(data){
		  alert("对不起，系统出现错误。请您刷新页面")
	  }
	  function succCommentsFunction(data){
		  $("#comments").remove();
		  var totalComment="";
		  var json = eval(data);
		 
					var flag = json.flag;
		  			var parents = json.parentComment;
					var children = json.childrenCommentMap;
					var halfComment = "";
					var totalNow = 3;
					for (var p = 0; p < parents.length; p++) {
						var ps = parents[p];
						var pCom = "<div class='pl-top' id='comments'>";
						pCom+="<div class='pl-self-tx'><img src = '${pageContext.request.contextPath}/resources/wap/img/tx.jpg' alt=''/></div>";
						pCom+="<div class=pl-con><div class='mc'>匿名用户"+ps.userId+"</div>";
						pCom+="<div class='com'>"+ps.content+"</div>";
						pCom+="<div class='gn'  parentsId='"+ps.id+"'><span>"+ps.createTimeStr+"</span><span class='fa fa-commenting-o float-r pp'></span></div>";
						
						for (var c in children) {
							if (c==p) {
								var chList = children[c];
								var cCount = children["count"+c];
								//alert(cCount);
								if(chList.length>0){
									pCom += "<div class='hf'>";
									for (var a = 0; a < chList.length; a++) {
										var chs = chList[a];
										pCom += "<div>";
										pCom += "<div class='pl-self-tx'><img src = '${pageContext.request.contextPath}/resources/wap/img/tx.jpg' alt=''/></div>";
										pCom += "<div class='mc'>"+chs.userId+"</div>";
										pCom += "<div class='com'>"+chs.content+"</div>";
										pCom += "<div class='gn' parentsId='"+ps.id+"'><span>"+chs.createTimeStr+"</span><span class='fa fa-commenting-o float-r pp'></span></div>";
										pCom += "</div>";
									}
									if (chList.length==3 && totalNow<cCount) {
										pCom += "<input type='text' id='pagecount' style='display:none;' value='0'/>";
										pCom += "<div class='hf-more' onclick=showAllChildren("+ps.id+",this)>查看全部回复</div>"
									}
										pCom+="</div>";
								}
							}
						}
						pCom += "</div></div>";
						halfComment=halfComment+pCom;
						
					}
					
					//halfComment += "</div></div>";
					if("next" == flag){
						halfComment +="<input type='text' id='ppCount' style='display:none;' value='0'/>";
						halfComment +="<div id='next' style='text-align:center' onclick=showAllParents(this)>点击加载更多...</div>";
					}else if("none" == flag){
						halfComment +="<div style='text-align:center'>暂无评论</div>"
					}else if("last" == flag){
						halfComment +="<div style='text-align:center'>下面没有评论了</div>"
					}
					totalComment = halfComment;
					
		 
		  $("#commentArea").html(totalComment);
	  }
	  
	 /*
	  *父评论分页方法
	  */
	  function showAllParents(obj){
		 $this=$(obj);
		  var $c = $this.prev("input").val();
		  var pgNo= $c-1+2;
		  //alert(pgNo);
		  
		  $.ajax({
			  type: "GET",
	            url:"${pageContext.request.contextPath}/wap/detail/recomments.html", 
	           	data: {videoId:'${video.id}',pageNo:pgNo},
	            dataType: "json",  
	            timeout: 1000,  
	            cache: false, 
	            async: false,
	            error: function(){ //错误执行方法    
	            	 alert("查出问题啦！程序猿正在解决，请先看点别的吧~")
	            },  
	            success:function(data){
	            	//先移除之前的页码和this
	            	$this.prev("input").remove();
	            	$this.css("display","none");
	            	//处理回调数据
	            	var totalComment="";
	            	var totalNow = 3;
	      		 	var json = eval(data);
	      		 			//alert("阻塞点1");
	      					var flag = json.flag;
	      		  			var parents = json.parentComment;
	      					var children = json.childrenCommentMap;
	      					var halfComment = "";
	      					for (var p = 0; p < parents.length; p++) {
	      						//alert("阻塞点2");
	      						var ps = parents[p];
	      						var pCom = "<div class='pl-top' id='comments'>";
	      						pCom+="<div class='pl-self-tx'><img src = '${pageContext.request.contextPath}/resources/wap/img/tx.jpg' alt=''/></div>";
	      						pCom+="<div class=pl-con><div class='mc'>匿名用户"+ps.userId+"</div>";
	      						pCom+="<div class='com'>"+ps.content+"</div>";
	      						pCom+="<div class='gn'  parentsId='"+ps.id+"'><span>"+ps.createTimeStr+"</span><span class='fa fa-commenting-o float-r pp'></span></div>";
	      						
	      						for (var c in children) {
	      							//alert("阻塞点3");
	      							if (c==p) {
	      								var chList = children[c];
	      								var x = "count"+c;
	      								var cCount = children[x];
	      								if(chList.length>0){
	      									pCom += "<div class='hf'>";
	      									for (var a = 0; a < chList.length; a++) {
	      										var chs = chList[a];
	      										pCom += "<div>";
	      										pCom += "<div class='pl-self-tx'><img src = '${pageContext.request.contextPath}/resources/wap/img/tx.jpg' alt=''/></div>";
	      										pCom += "<div class='mc'>"+chs.userId+"</div>";
	      										pCom += "<div class='com'>"+chs.content+"</div>";
	      										pCom += "<div class='gn' parentsId='"+ps.id+"'><span>"+chs.createTimeStr+"</span><span class='fa fa-commenting-o float-r pp'></span></div>";
	      										pCom += "</div>";
	      									}
	      									//alert("阻塞点4");
	      									if (chList.length==3 && totalNow<cCount) {
	      										pCom += "<input type='text' id='pagecount' style='display:none;' value='0'/>";
	      										pCom += "<div class='hf-more' onclick=showAllChildren("+ps.id+",this)>查看全部回复</div>"
	      									}
	      									//alert("阻塞点5");
	      										pCom+="</div>";
	      								}
	      							}
	      						}
	      						//alert("阻塞点6");
	      						pCom += "</div></div>";
	      						halfComment=halfComment+pCom;
	      						
	      					}
	      					//alert("阻塞点7");
	      					//halfComment += "</div></div>";
	      					if("next" == flag){
	      						halfComment +="<input type='text' id='ppCount' style='display:none;' value='"+pgNo+"'/>";
	      						halfComment +="<div id='next' style='text-align:center' onclick=showAllParents(this)>点击加载更多...</div>";
	      					}else if("none" == flag){
	      						halfComment +="<div style='text-align:center'>暂无评论</div>"
	      					}else if("last" == flag){
	      						halfComment +="<div style='text-align:center'>下面没有评论了</div>"
	      					}
	      					totalComment = halfComment;
	      					
	      					$this.parent().append(totalComment);
	      					afterAdd();
	            	
	            }
		  })
	 }
	  
	  
	  
	 /*
	  * 拉取子评论分页的方法
	  */
	  function showAllChildren(pId,obj){
		  $this=$(obj);
		  var con =  $this.parent();
		  var $c = con.find("input").val();
		  var pgNo= $c-1+2;
		  
		  $.ajax({  
		    	 
			  	type: "GET",
	            url:"${pageContext.request.contextPath}/wap/detail/pullChildren.html", 
	           	data: {parentId:pId,pageNo:pgNo},
	            dataType: "json",  
	            timeout: 1000,  
	            cache: false, 
	            async: false,
	            error: function(){ //错误执行方法    
	            	 alert("查出问题啦！程序猿正在解决，请先看点别的吧~")
	            },  
	            success:function(data){//成功执行方法  
	            	$this.remove();
	            	con.find("input").remove();
					var cCom = "";
	            	var json = eval(data);
	            	var list = json.list;
	            	var count = json.count;
	            	var totalNow = (pgNo+1)*3;
	             	for (var i = 0; i < list.length; i++) {
						var chs = list[i];
						
						cCom += "<div>";
						cCom += "<div class='pl-self-tx'><img src = '${pageContext.request.contextPath}/resources/wap/img/tx.jpg' alt=''/></div>";
						cCom += "<div class='mc'>"+chs.userId+"</div>";
						cCom += "<div class='com'>"+chs.content+"</div>";
						cCom += "<div class='gn' parentsId='"+chs.parentId+"'><span>"+chs.createTimeStr+"</span><span class='fa fa-commenting-o float-r pp'></span></div>";
						cCom += "</div>";
					}
	             	if(list.length==3 && totalNow<count ) {
						cCom += "<input type='text' id='pagecount' style='display:none;' value='"+pgNo+"'/>";
						cCom += "<div class='hf-more' onclick=showAllChildren("+chs.parentId+",this)>查看全部回复</div>";
					}
	             		con.append(cCom);
	             }    
	         });
	 	}
	  
	  /*
	   * 一个点赞用的方法
	   */
	   function addLikeCount(){
		 	var vId="${video.id}";
	    	$.ajax({  
		    	 type: "GET",
	             url:"${pageContext.request.contextPath }/wap/detail/insertComment1.html", 
	           	 data: {videoId:vId,type:"1",parentId:"",content:"",childrenCount:""},
	             dataType: "json",  
	             timeout: 1000,  
	             cache: false, 
	             async: false,
	             error: errorLikeFunction,  //错误执行方法    
	             success: succLikeFunction  //成功执行方法    
	         });
	    }
	  function errorLikeFunction(data){
		  alert("对不起没点赞成功，您老再点一下试试？");
	  }
	  function succLikeFunction(data){
		  //刷新点赞数量
		  flusLikeCount();
	  }
	  /*
	   *修改页面上赞的个数
	   */
	  function flusLikeCount(){
		  var vId="${video.id}";
	    	$.ajax({  
		    	 type: "GET",
	             url:"${pageContext.request.contextPath }/wap/detail/flusCount.html", 
	           	 data: {videoId:vId,type:"1",code:"like_count"},
	             dataType: "json",  
	             timeout: 1000,  
	             cache: false, 
	             async: false,
	             success:function(data){
	            	 $("#zan").text(data);
	             }   
	         });
	  }
	</script>
	
</body>
</html>